home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / itrns211.zip / DOC / FLAG.IPS < prev    next >
Text File  |  1991-10-15  |  5KB  |  153 lines

  1. % Devanagari Example
  2. %
  3. % This is an example direct PostScript input to the itrans program.
  4. % This file shows how to change fonts, change font size, etc
  5. % in the file..
  6. %
  7. % Prints indian anthem, flag song, and the flag itself! Must SEE!
  8.  
  9. % *** Thanks to Anurag Shankar for making lots of spelling corrections
  10. %     in the original document I wrote... [abc]
  11.  
  12. % 15 englishfont % set current font to be an english font (see itrans.pro)
  13. % (itrans sample file: flag.ips) show
  14. % first, the two songs......
  15.  
  16. % define functions that load in the font..
  17. /devn18 {
  18.     18 normalfont % get the normal devnagri font, at 18 point size
  19. } def
  20.  
  21. /devns25 {
  22.     25 slantfont     % define a slanted font, using the a 25pt font size
  23. } def
  24.  
  25. \hindiifm=devnac.ifm
  26. \hindifont=devn18
  27.  
  28. newline    % skip down one lines
  29.  
  30. \hindi
  31. vijayii vishvatira.ngaa pyaaraa |
  32.     jha.nDaa uu.Cchaa rahe hamaaraa ||
  33. sadaa shakti sarasaanevaalaa |
  34. premasudhaa barasaanevaalaa ||
  35. viiro.nko harashhaanevaalaa |
  36. maatRibhuumi kaa tanamana saaraa |
  37.     jha.nDaa uu.Cchaa rahe hamaaraa ||
  38. shaana na isakii jaane paaye |
  39. chaahe jaana bhale hii jaaye ||
  40. vishvavijaya karake dikhalaaye |
  41. taba hove praNa puurNa hamaaraa |
  42.     jha.nDaa uu.Cchaa rahe hamaaraa ||
  43. \endhindi
  44.  
  45. newline
  46. 0.4 setlinewidth
  47. currentpoint
  48. currentpoint exch pop 0.0 exch moveto
  49. 206 0 rmoveto 200 0 rlineto stroke % draw a straight line..
  50. moveto % use x,y of first currentpoint above
  51.        % this is important, the current point must always exist
  52.        % for itrans.pro and this document to print correctly:
  53.        % the macros newline, etc make use of it.
  54. newline
  55.  
  56. \hindifont=devns25 % use the slanted font, 25pt font size
  57.  
  58. % in the following text, you will see braces around g of gya : bhaa{g}ya
  59. % this is because gy itself is a consonant: (as in gyaan)
  60. % so, to prevent it from tacking "y" onto the "g", we break it up
  61. % with the braces, to get ga-half, and ya. Braces are not copied to the output.
  62.  
  63. \hindi
  64.         jana gaNa mana adhinaayaka jaya he
  65.             bhaarata bhaa{g}ya vidhaataa
  66.         pa.njaaba si.ndha gujaraata maraaThaa
  67.             draviDa utkala ba.nga
  68.         vi.ndhya himaachala yamunaa ga.ngaa
  69.             uchchhala jaladhi tara.nga
  70.         tava shubha naame jaage
  71.         tava shubha aashiishha maa.nge
  72.             gaahe tava jaya gaathaa
  73.         jana gaNa ma.ngala daayaka jaya he
  74.             bhaarata bhaa{g}ya vidhaataa
  75.         jaya he jaya he jaya he
  76.             jaya jaya jaya jaya he
  77.  
  78.  
  79.                          - raviindranaatha Taagora
  80. \endhindi
  81.  
  82. % now, code to draw an indian flag.
  83. % draw the center wheel
  84. /drawwheel { % diameter drawwheel --
  85.          % draws a wheel at the currentpoint, of the  given diameter
  86.  
  87.     2 div /rad exch def % get radius
  88.     gsave
  89.  
  90.     currentpoint translate
  91.  
  92.     0 0 rad 0 360 arc stroke    % draw the wheel outline
  93.  
  94.     % compute radius of the small circles hanging off the wheel..
  95.     /smallrad rad 7.5 sin mul def
  96.     /smallcx rad 7.5 cos mul def
  97.  
  98.     0 15 345 { % draw the 24 spokes
  99.     gsave
  100.     rotate % use the for loop variable value, 0..245
  101.  
  102.     0 0 moveto rad 0 lineto stroke % draw spoke
  103.  
  104.     smallcx smallrad -1 mul smallrad 82.5 262.5 arc fill
  105.     grestore
  106.     } for
  107.     grestore
  108. } def
  109.  
  110. % draw the entire flag 
  111. /drawflag { % width drawwheel --
  112.          % draws a flag at the currentpoint, of the  given width
  113.          % (height = width/2)
  114.     /width exch def
  115.     gsave
  116.     currentpoint translate
  117.     /height width 2.0 div def
  118.     /hrect height 3.0 div def
  119.  
  120.     % draw bottom green rect (use intensity = 58.7%)
  121.     0.413 setgray
  122.     0 0 moveto width 0 lineto width hrect lineto 0 hrect lineto
  123.     closepath fill
  124.  
  125.     % draw top saffron rect (== 100% red, 34% green use intensity=50.0%)
  126.     0 hrect 2.0 mul translate
  127.     0.8 setgray % 0.5 was too similar to green, so lighten it..
  128.     0 0 moveto width 0 lineto width hrect lineto 0 hrect lineto
  129.     closepath fill
  130.     0 hrect -2.0 mul translate % restore matrix
  131.  
  132.     % draw center wheel
  133.     0 setgray
  134.     0.8 setlinewidth
  135.     width 2.0 div height 2.0 div moveto
  136.     hrect 0.95 mul drawwheel
  137.  
  138.     % draw a boundary
  139.     0 setgray 0.4 setlinewidth
  140.     0 0 moveto width 0 lineto width height lineto 0 height lineto
  141.     closepath stroke
  142.     0 hrect moveto width hrect lineto stroke
  143.     0 hrect hrect add moveto width hrect hrect add lineto stroke
  144.  
  145.     grestore
  146. } def
  147.  
  148. % draw the flag next to the first song...
  149. 250 560 moveto 300 drawflag
  150.  
  151. % no showpage in flag.ips, since itrans will produce it..
  152.  
  153.